// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import '../src/assets/css/style.css'



Vue.config.productionTip = false;
Vue.config.devtools = true;

// 蓝湖上设计稿自定义为375px 测量值直接写入即可
(function() {
  const baseSize = 16; // 32
  function setRem() {
    const scale = document.documentElement.clientWidth / 375; // 750
    document.documentElement.style.fontSize =
      baseSize * Math.min(scale, 2) + "px";
  }

  window.onresize = function() {
    setRem();
  };
})();

// new Vue({
//   router,
//   el: '#app',
//   template: '<App/>',
//   components: {
//     App
//   }
// })


if(process.env.NODE_ENV === "development") {
   new Vue({
    router,
    el: '#app',
    template: '<App/>',
    components: {
      App
    }
  })
} else {
  // 生产环境需要确保cordova加载完成
  document.addEventListener('deviceready', function() {
     new Vue({
      router,
      el: '#app',
      template: '<App/>',
      components: {
        App
      }
    })
  }, false);
}



